package boot

type ErrorCode int

type BizError struct {
	Code    ErrorCode
	Message string
	Cause   error
}

func (e *BizError) Error() string {
	return e.Message
}

func NewBizError(code ErrorCode, message string) *BizError {
	return &BizError{
		Message: message,
		Code:    code,
	}
}

func NewBizErrorCause(code ErrorCode, message string, cause error) *BizError {
	return &BizError{
		Message: message,
		Code:    code,
		Cause:   cause,
	}
}
